package com.example.springboot.controller;

import com.example.springboot.common.Result;
import com.example.springboot.common.enums.ResultCodeEnum;
import com.example.springboot.exception.CustomException;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 功能:
 * 作者: whs
 * 日期:20240921 13:47:30
 */
@RestController
@RequestMapping("test")
public class TestController {
    @GetMapping("/hello")
    public Result hello(){
//        throw new CustomException(ResultCodeEnum.PARAM_ERROR);
        Test user=new Test();
        user.setName("张三");
        user.setAge(18);
        return Result.success(user);
    }
}